#ifndef _GRO_BUTTON_H__
#define _GRO_BUTTON_H__

#include <list>
#include "GRO_Gui.h"
#include "GRO_Text.h"


namespace GRO
{


class Button : public Widget
{
private:
    bool _pressed;

    GRO_FramePainterID frameDownPainter;

    Text text;
    
public:

    Button();
    Button(const Dimensions& dims);
    Button(const Dimensions& dims, const std::string& textString);

    virtual ~Button();
    
    GRO_FramePainterID getFrameDownPainter();
    void setFrameDownPainter(GRO_FramePainterID Frame);
    /*
    virtual void applyTheme(Theme* theme, bool recursive = 0);
    }*/
    
    Text& getText();
    const Text& getText() const;
    
    bool isPressed() const;
    void setPressed(bool pressed);

    virtual void draw(SDL_Rect* clipRect);

    virtual Widget* findWidget(int mx, int my);
    virtual std::list<Widget*> getChildren();
    
    virtual Widget* action(PointerCursor* mouse, ActionEnum actionType);
    virtual Widget* action(NavCursor* nav, ActionEnum actionType);
    
    virtual TiXmlElement* save(TiXmlElement* parent);
    virtual bool load(TiXmlElement* w);

};
    
}
    
#endif

